import { defineStore} from 'pinia'
 
export const mainStore = defineStore('main',{
  state:()=>{
    return {
        cookies:localStorage.getItem("cookies"),
        permissions:<any>localStorage.getItem("permissions")
    }
  },
  getters:{
    isAuthenticated():boolean{
        return !!this.cookies
    }
},
  actions:{
    login(data:any,cookies:any) {
        localStorage.setItem("permissions",data)
          
    },
    loginout() {
        console.log(this.permissions)
    }
}
})